﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
                assembly="Inovout.Membership"
				        namespace="Inovout.Membership.Security">

  <class name="MembershipUser" table="Membership_MembershipUser">
    <id name="Id" access="field.camelcase"
        column="MembershipUserId" type="Int32">
      <generator class="native" />
    </id>

    <property name="Name" />


    <set name="Credentials"  cascade="all" inverse="false">
      <key column="MembershipUserId"></key>
      <one-to-many class="Inovout.Membership.Security.MembershipCredential,Inovout.Membership" />
    </set>

    <set name="Roles" inverse="true">
      <key column="RoleId"></key>
      <one-to-many class="Inovout.Membership.Security.Role,Inovout.Membership"/>
    </set>

    <many-to-one name="Membership" column="MembershipId" foreign-key="FK_Membership_MembershipId_MembershipUser_MembershipId" class="Inovout.Membership.Domain.Membership,Inovout.Membership.Domain" cascade="all"/>
  
    <property name="CreatedTime" access="field.camelcase" />
    <property name="CreatedUserName" access="field.camelcase" />
    <property name="ModifiedTime" access="field.camelcase" />
    <property name="ModifiedUserName" access="field.camelcase" />
    <property name="AccessedTime" access="field.camelcase" />
    <property name="AccessedUserName" access="field.camelcase" />
    <property name="Memo" />
    <property name="IsInvalid" />
  </class>
</hibernate-mapping>


